home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 23 / Amiga Format AFCD23 (Feb 1998, Issue 107).iso / -seriously_amiga- / shareware / workbench / ezcron / ezcron.install < prev    next >
Text File  |  1997-12-06  |  6KB  |  290 lines

  1. ; Installer Script for EZCron.
  2. ; 11/30/97  Jim Hines
  3.  
  4. ; set up an error cleanup routine
  5. (onerror
  6.     (makeassign "EZsrc" (safe))
  7.     (makeassign "EZdest" (safe))
  8. )
  9.  
  10.  
  11. (getassign "EZCron" "a")
  12.  
  13. ;started
  14. (complete 0)
  15.  
  16. ;cancel the assign in case of installation restart
  17. (makeassign "EZsrc" (safe))
  18. (makeassign "EZdest" (safe))
  19.  
  20. ; get the dest dir for EZCron (create it if it does not exist)
  21. (set ez_dest
  22.     (tackon
  23.         (askdir
  24.             (prompt "If you have not read the README.FIRST file\n, please do so before continuing.\n Where should EZCron be installed? A drawer named `EZCron' will be created.")
  25.             (help @askdir-help)
  26.             (default "Work:")
  27.         )
  28.         "EZCron"
  29.     )
  30. )
  31. (makeassign "EZdest"
  32.     (pathonly ez_dest)
  33.     (safe)
  34. )
  35.  
  36. (if (exists "EZdest:EZCron")
  37.     (+ 1 1)
  38.     (makedir
  39.         "EZdest:EZCron"
  40.         (infos)
  41.         (safe)
  42.     )
  43. )
  44.  
  45. (if (exists "EZdest:EZCron/Prefs")
  46.     (+ 1 1)
  47.     (makedir
  48.         "EZdest:EZCron/Prefs"
  49.         (safe)
  50.     )
  51. )
  52.  
  53. (if (exists "EZdest:EZCron/Doc")
  54.     (+ 1 1)
  55.     (makedir
  56.         "EZdest:EZCron/Doc"
  57.         (safe)
  58.         (infos)
  59.     )
  60. )
  61.  
  62. (if (exists "EZdest:EZCron/rexx")
  63.     (+ 1 1)
  64.     (makedir
  65.         "EZdest:EZCron/rexx"
  66.         (safe)
  67.     )
  68. )
  69.  
  70. (if (exists "EZdest:EZCron/ConfigFiles")
  71.     (+ 1 1)
  72.     (makedir
  73.         "EZdest:EZCron/ConfigFiles"
  74.         (safe)
  75.     )
  76. )
  77.  
  78. ;We now have a valid destination, so tell Installer where EZCron will end up
  79. ;so the exit page will be correct.
  80. (set @default-dest ez_dest)
  81.  
  82. ;copy program files from source to dest
  83. ;(copyfiles
  84. ;    (source "EZCrond")
  85. ;    (dest "EZdest:EZCron")
  86. ;    (infos)
  87. ;)
  88.  
  89. ; ASK WHETHER TO INSTALL IN WBSTARTUP OR USER-STARTUP
  90. (set name
  91.     (askchoice
  92.         (prompt "Where you you like EZCronD (Daemon) to be started from?")
  93.         (help @askoptions-help)
  94.         (choices "User-Startup" "WBStartup")
  95.         (default 0)
  96.     )
  97. )
  98. ; Copy EZCronD to EZDest: regardless of choice.
  99. (copyfiles
  100.     (source "EZCronD")
  101.     (dest "EZdest:EZCron")
  102.     (infos)
  103. )
  104.  
  105. (if (= name 1)
  106.     (set wbstart_dest
  107.         (askdir
  108.             (prompt "Select your WBStartup drawer.")
  109.             (help "Pick the WBstartup drawer you wish to install the EZCronD (Daemon) into.")
  110.             (default "sys:WBStartup")
  111.         )
  112.     )
  113. )
  114. (if wbstart_dest
  115.     (copyfiles
  116.         (source "EZCronD")
  117.         (dest wbstart_dest)
  118.         (infos)
  119.     )
  120. ) ;if
  121. ; END OF ASK WHETHER TO INSTALL IN WBSTARTUP OR USER-STARTUP
  122.  
  123.  
  124. (copyfiles
  125.     (source "EZCron")
  126.     (dest "EZdest:EZCron")
  127.     (infos)
  128. )
  129.  
  130.  
  131. (copyfiles
  132.     (source "ezc.gui")
  133.     (dest "EZdest:EZCron")
  134. )
  135.  
  136.  
  137. ;copy program files from source to dest
  138. (copyfiles
  139.     (source "readme")
  140.     (dest "EZdest:EZCron")
  141.     (infos)
  142. )
  143.  
  144. ;copy program files from source to dest
  145. (copyfiles
  146.     (source "README.FIRST")
  147.     (dest "EZdest:EZCron")
  148.     (infos)
  149. )
  150.  
  151. ;copy program files from source to dest
  152. (copyfiles
  153.     (source "Doc")
  154.     (dest "EZdest:EZCron/Doc")
  155.     (all)
  156. )
  157.  
  158.  
  159. (working "Copying the rexx scripts.")
  160. ;copy rexx files from source to dest
  161. (copyfiles
  162.     (source "rexx")
  163.     (dest "EZdest:EZCron/rexx")
  164.     (all)
  165. )
  166.  
  167. (working "Copying the example Configuration files.")
  168. ;copy Config files from source to dest
  169. (copyfiles
  170.     (source "ConfigFiles")
  171.     (dest "EZdest:EZCron/ConfigFiles")
  172.     (all)
  173. )
  174.  
  175.  
  176. (copyfiles
  177.     (prompt "Select which .prefs files you wish copied.\n See HELP.")
  178.     (help "If you are upgrading from EZCron v2.++, you will probably not want to overwrite your existing preferences files. If this is a first time install, you will need these files.")
  179.     (source "prefs")
  180.     (dest "EZdest:EZCron/prefs")
  181.     (pattern "#?.prefs")
  182.     (files)
  183.     (confirm)
  184. )
  185.  
  186.  
  187. ; Ask the user if he wants the config.file copied to s:
  188.  
  189. (if (askbool (prompt "Do you wish to copy the included example cron.config file to your s: directory?\n See HELP")
  190.     (help "Release 2 cron.config files are no longer compatable with the current format.")
  191.         (default 0))
  192.         (
  193.         ; Ok. Install it anyway!
  194.           (set InstallConfig TRUE)
  195.         )
  196. )            
  197.  
  198. (if InstallConfig
  199.         (copyfiles
  200.             (source "s/cron.config")
  201.             (dest "s:")
  202.         )
  203. )
  204.  
  205.  
  206. ;copy library files from source to dest with version checking
  207. (copylib
  208.     (prompt "Copying library\n arexxport.library")
  209.     (help "Copy Librarys")
  210.     (source "Libs/arexxport.library")
  211.     (dest "libs:")
  212.     (confirm)
  213. )
  214.  
  215.  
  216. ;copy library files from source to dest with version checking
  217. (copylib
  218.     (prompt "Copying library\n rexxreqtools.library")
  219.     (help "Copy Librarys")
  220.     (source "Libs/rexxreqtools.library")
  221.     (dest "libs:")
  222.     (confirm)
  223. )
  224.  
  225. ;copy Varexx files from source to dest with version checking
  226. (copylib
  227.     (prompt "Copying Varexx to sys:rexxc")
  228.     (help "Copy VArexx")
  229.     (source "rexxc/VArexx")
  230.     (dest "sys:rexxc")
  231.     (confirm)
  232. )
  233.  
  234.  
  235. ;copy Varexx files from source to dest with version checking
  236. (copyfiles
  237.     (source "rexxc/VXC")
  238.     (dest "sys:rexxc")
  239. )
  240.  
  241. ;add the assign for EZCron: to user-startup
  242. (set ezassign ("Assign EZCron: \"%s\"\n" ez_dest))
  243.  
  244. ;add program startup to s:user-startup sequence
  245. (set ezrexxstart ("run <>NIL: rx EZCron:EZCrond start \n"))
  246. (startup "EZCron"
  247.     (prompt "EZCron requires that an AmigaDOS assign be created. It WILL NOT work properly without it! The following will be added to your s:user-startup file:\n\n"
  248.         ezassign
  249.         "\nIs it okay to add this now?"
  250.         "\n\nIMPORTANT: Reboot your computer or manually assign EZCron: before using for the first time."
  251.     )
  252.         (help "This is required if installing EZCron for the first time.")
  253.         (command ezassign)
  254. )
  255.  
  256. (if (= name 0)
  257.     (startup "EZCron"
  258.         (prompt "Since you opted to NOT install EZCronD in WBStartup, this command must also be added to your user-startup sequence:\n\n"
  259.             ezrexxstart
  260.             "\nIs it okay to add this now?"
  261.             "\n\nIMPORTANT: REBOOT YOUR COMPUTER BEFORE EZCRON FOR THE FIRST TIME."
  262.         )
  263.             (help "This is required if installing EZCron for the first time.")
  264.             (command ezrexxstart)
  265.     )
  266. )
  267.  
  268. (complete 95)
  269.  
  270. ;un-snapshot the EZCron drawer icon
  271. (tooltype
  272.     (dest ez_dest)
  273.     (noposition)
  274. )
  275.  
  276.  
  277. ;finished with install
  278. (complete 100)
  279.  
  280. ;cleanup
  281. (makeassign "EZsrc" (safe))
  282. (makeassign "EZdest" (safe))
  283.  
  284. ;display the guide file
  285. (run "run sys:utilities/multiview doc/ezcron.guide" (safe))
  286.  
  287. ;leave
  288. (exit)
  289.  
  290.